package com.hxzy.common.enums;

/**
 * 响应枚举
 */
public enum RCodeEnum {
    SUCCESS(200, "Success"),
    PARAMETERS_ERROR(201,"参数不正确"),
    UPLOAD_IMAGE_EXTSION(203,"只支持上传.png和.jpg格式的图片"),
    UPLOAD_IMAGE_SIZE(204,"图片大小不能超过2MB"),
    FILE_NOT_EMPTY(205,"上传文件不能为空"),
    UPLOAD_FILE_ERROR(206,"上传文件失败"),
    DATABASE_ERROR(207,"数据库写入失败"),
    DATABASE_NOT_FOUND(208,"数据库未找到数据"),
    PERMISSION_DENIED(209,"权限不足"),
    DATABASE_UPDATE_ERROR(210,"数据库更新失败"),
    DATABASE_DELETE_ERROR(211,"数据库删除失败"),
    DATABASE_INSERT_ERROR(212,"数据库插入失败"),
    DATABASE_SELECT_ERROR(213,"数据库查询失败"),
    DATABASE_NOT_NULL(214,"数据库不能为空"),
    DATABASE_NOT_UNIQUE(215,"数据库数据不唯一"),
    DATABASE_NOT_EXIST(216,"数据库数据不存在"),
    DATABASE_NOT_EMPTY(217,"数据库数据不能为空"),


    ERROR(500, "Error"),
    TOKEN_EXPIRED(614, "令牌已过期"),

    //用户相关的功能300-399
    ACCOUNT_ERROR(300,"用户名或密码错误"),
    ACCOUNT_LOCKED(302,"账号被锁定，不能登录"),
    CAPTCHA_UUID_NOT_NULL(301,"验证码标识不能为空"),
    CAPTCHA_EXPIRE(303,"验证码已过期"),
    CAPTCHA_ERROR(304,"验证码错误"),
    ACCOUNT_NOT_EXIST(305,"用户不存在"),
    ACCOUNT_EXIST(306,"用户已存在"),
    ACCOUNT_NOT_LOCKED(307,"用户未锁定"),
    ACCOUNT_NOT_ENABLE(308,"用户未启用"),
    ACCOUNT_NOT_EXPIRED(309,"用户未过期"),
    ACCOUNT_NOT_CREDENTIALS(310,"用户凭证未过期"),
    ACCOUNT_PASSWORD_ERROR(311,"两次密码不一致")

    //商品相关的功能400-499
    //支付相关的功能501-599

    ;

    private final int code;
    private final String message;

    RCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
